<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="ActivityForm.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="activityForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': activityForm.subject.$invalid && activityForm.subject.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动主题：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control" name="subject" placeholder="活动主题" ng-model="activity.subject" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.content.$invalid && activityForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2">内容：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="content" placeholder="发表的活动内容" id="editor" bind-model="activity.content" ng-bind-html="activity.content | trustHtml" keditor data-config="options" required ng-model="activity.contentBody">
            </textarea>
            <autosave module="activity" saveId="{{activity.id}}" interval="30000"></autosave>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.summary.$invalid && activityForm.summary.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动摘要：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control" name="summary" placeholder="活动摘要" ng-model="activity.summary">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.address.$invalid && activityForm.address.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动地点：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="address" placeholder="活动地点" ng-model="activity.address">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.startTime.$invalid && activityForm.startTime.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动时间：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" name="startTime" id="startTime" idate placeholder="开始时间" ng-model="activity.startTime" required> <span class="to fl">至</span> <input type="text" class="form-control w25c fl" name="endTime" id="endTime" idate placeholder="结束时间" ng-model="activity.endTime" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.amount.$invalid && activityForm.amount.$dirty}">
          <label class="control-label col-xs-3 col-md-2">开放报名数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="amount" placeholder="开放报名数" ng-model="activity.amount">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.price.$invalid && activityForm.price.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动费用：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="price" placeholder="活动费用" ng-model="activity.price">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': activityForm.status.$invalid && activityForm.status.$dirty}">
          <label class="control-label col-xs-3 col-md-2">活动状态：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="status" required ng-model="activity.status">
              <option ng-repeat="item in activity.statusList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">活动图标：</label>
          <div class="col-xs-7 col-md-8">
            <div class="button btn btn-primary fl" ngf-select="upload($file)" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <bannerlist></bannerlist>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="activityForm.$invalid">发表</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>

<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>